/**
 * 
 * 公用接口放这里
*/
//获取数据字典
import {request} from './request.js'
export const getDicData = async function(){
	const ret  = await request({
		url:'cache/get.do',
		data:{
			key:'pubcode',
			cacheObject:'pubcode'
		}
	})
	if(ret.data.success){
		return ret.data.attributes.value
	} else {
		uni.showToast({
			title:'获取数据字典失败',
			icon:'none'
		})
	}
}

//信息管理列表接口
export const getListData = async function({pageSize,pageNo,sortField,sortOrder,moduleId,CREATE_TIME}){
	const ret  = await request({
		url:`info/${moduleId}/ajaxSearch.do`,
		data:{
			pageSize,
			pageNo,
			sortField,
			sortOrder,
			moduleId,
			CREATE_TIME
		}
	})
	if(ret.data.success){
		console.log('list',ret.data)
		return ret.data
	} else {
		uni.showToast({
			title:ret.data.message,
			icon:'none'
		})
	}
}
